package com.yanqu.road.server.cmd.activity.xiuxian;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.XiuXianProto;
import com.yanqu.road.pb.cross.activity.CrossActivityProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.xiuxian.CrossXiuXianMgr;
import com.yanqu.road.server.manager.activity.xiuxian.activity.CrossXiuXianActivity;
import com.yanqu.road.server.protocol.CrossProtocol;

@Cmd(code = CrossProtocol.C_CROSS_XIU_XIAN_GET_SERVER_SCORE, desc = "区服上报数据")
public class CrossXiuXianGetServerScoreCmd extends CrossCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        XiuXianProto.XiuXianGetServerScoreToCrossMsg reqMsg = XiuXianProto.XiuXianGetServerScoreToCrossMsg.parseFrom(packet.getBytes());
        CrossXiuXianActivity activity = CrossXiuXianMgr.getActivity(reqMsg.getActivityId());
        if (activity != null) {
            activity.getServerScore(serverId, reqMsg.getServerScore());
        }
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {

    }

    @Override
    public void sendData() {

    }
}
